<?php if(!defined('BASEPATH')) exit ('No direct script access allowed');

class Respected_people extends public_controller
{
	
	public function __construct() {
		parent:: __construct();
		$this->template->set_layout('person_layout');
		if(!$this->session->userdata('loginStatus')) redirect('landing');
		//$this->load->model('person/person_model');
		$this->load->helper('date');
	}

	public function index() {
		$current_person_id = (int)$this->uri->segment(2);
		$infoPerson = $this->person_model->get_person($current_person_id);
		$sql = "SELECT id,fullname, avatar 
				FROM member 
				WHERE id IN(SELECT memId FROM respected_for_people WHERE personId= $current_person_id) ";	
		$sql = $this->db->query($sql);
		$result = $sql->result_array();

		$this->current_person_id = $current_person_id;

		$this->template->title('Respected people', 'Dead project')
			->set(array('infoPerson' => $infoPerson, 'listPeople' => $result))
			->build('respected_people/index');
	}
}
/*End file respected_people */
/* File local: application/controller/...*/